package com.sc.nft.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.Objects;

/**
 * @author 刘国航
 * @since 2024/6/4 10:15
 */
@AllArgsConstructor
@Getter
public enum PushManageTypeEnum {

    ALL_PUSH(1, "全量推送"),
    TAG_PUSH(2, "标签推送")
    ;
    @EnumValue
    private Integer code;
    private String description;

    public static PushManageTypeEnum fromCode(Integer code) {
        if(Objects.isNull(code))
        {
            return null;
        }
        for(PushManageTypeEnum pushManageTypeEnum : values()) {
            if(pushManageTypeEnum.code.equals(code)) {
                return pushManageTypeEnum;
            }
        }
        return null;
    }

}
